package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._11抽象工厂模式._2多数据库;

public class Test {

	public static void main(String[] args){
        User user = new User();
        
        IFactory factory = new SqlserverFactory();
        IUser iu = factory.createUser();

        iu.insert(user);    //新增一个用户
        iu.getUser(1);      //得到用户ID为1的用户信息

        IFactory factory2 = new AccessFactory();
        IUser iu2 = factory2.createUser();

        iu2.insert(user);    //新增一个用户
        iu2.getUser(1);      //得到用户ID为1的用户信息

	}
}

